package com.atguigu.tingshu.search.service.impl;

import com.atguigu.tingshu.search.service.ItemService;
import com.atguigu.tingshu.search.service.MqOpsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Author:huzhongkui
 * Date: 2025-03-21 星期五 10:17:15
 * Description:
 */
@Service
@Slf4j
public class MqOpsServiceImpl implements MqOpsService {

    @Autowired
    private ItemService itemService;


    @Override
    public void albumUpper(String albumId) {
        itemService.albumOnSale(Long.parseLong(albumId));
        log.info("上架专辑到es成功!");
    }

    @Override
    public void albumLower(String albumId) {
        itemService.albumOffSale(Long.parseLong(albumId));
        log.info("专辑从es中下架成功!");
    }
}
